<template>
  <div class="app-container">
    <el-dialog :title="pageTitle" :visible.sync="dialogFormVisible" :before-close="beforeClose" width="30%">
      <el-input v-model="data" placeholder="请填写拒绝提现理由" />
      <div slot="footer" class="dialog-footer">
        <el-button @click="canel">取 消</el-button>
        <el-button @click="sure()">确认</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { Message } from 'element-ui'
import { refuse } from '@/api/withdraws'
export default {
  name: 'WithdrawsHandle',
  data() {
    return {
      data: '',
      dialogFormVisible: false,
      pageTitle: '拒绝提现理由',
      id: ''
    }
  },

  methods: {
    beforeClose() {
      this.canel()
    },
    canel() {
      this.dialogFormVisible = false
    },

    handle(id) {
      this.dialogFormVisible = true
      this.id = id
      this.data = ''
    },

    sure(handleType) {
      refuse({ id: this.id,data: this.data }).then(res => {
        Message.success('操作成功')
        this.$emit('afterSave')
        this.canel()
      })
    }
  }
}
</script>
